﻿CREATE TRIGGER [t_Menu_Event]
ON [dbo].[t_Menu]
FOR DELETE
AS

IF NOT EXISTS(SELECT * FROM t_MenuEvent me INNER JOIN deleted d ON d.MenuID IN (me.MenuFromID,me.MenuToID))RETURN

ROLLBACK TRAN
RAISERROR('Menu has Event Action assigned to it. Delete it first.',16,1)

